/*
 * Parent.java
 *
 * Creada el 30/01/2012, 04:28:03 PM
 *
 * Clase Java desarrollada por Edgar Ramos para 7i Software Factory el día 30/01/2012
 *
 * Para informacion sobre el uso de esta clase, asi como bugs, actualizaciones, o mejoras enviar un mail a
 * eramos@7i.com.mx
 *
 * Desarrollado por la célula de desarrollo de Zacatecas
 *
 */
package com.grupoquark.cic.model.person;

import com.grupoquark.cic.model.contact.Contact;
import com.grupoquark.cic.model.register.DebtRegister;
import com.grupoquark.cic.model.register.PaymentRegister;
import java.util.List;
import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;

/**
 * @author Edgar Ramos
 * @version 1.0
 * @author-mail eramos@7i.com.mx
 * @date 30/01/2012
 */
@Entity
@Table(name = "parents")
public class Parent extends Person
{
    @OneToMany(cascade = CascadeType.PERSIST)
    private List<DebtRegister> debts;
    @OneToMany(cascade = CascadeType.PERSIST)
    private List<PaymentRegister> payments;
    @OneToOne(cascade = CascadeType.PERSIST)
    private Contact contact;
    @OneToMany(cascade = CascadeType.PERSIST)
    private List<Child> children;

    protected Parent()
    {
    }

    public Parent(String name, String firstSurname, String secondSurname)
    {
        super(name, firstSurname, secondSurname);
    }

    public Parent(String name, String firstSurname)
    {
        super(name, firstSurname);
    }

    public List<Child> getChildren()
    {
        return children;
    }

    public void setChildren(List<Child> children)
    {
        this.children = children;
    }

    public Contact getContact()
    {
        return contact;
    }

    public void setContact(Contact contact)
    {
        this.contact = contact;
    }

    public List<DebtRegister> getDebts()
    {
        return debts;
    }

    public void setDebts(List<DebtRegister> debts)
    {
        this.debts = debts;
    }

    public List<PaymentRegister> getPayments()
    {
        return payments;
    }

    public void setPayments(List<PaymentRegister> payments)
    {
        this.payments = payments;
    }

    @Override
    public String toString()
    {
        return "Parent{" + "debts=" + debts + ", payments=" + payments + ", contact=" + contact + ", children=" + children + '}';
    }
}
